/*
 * RemoveDocumentDestination.java
 *
 * Created on January 4, 2005, 2:42 PM
 */

package org.infoset.xml.filter;

import java.util.*;
import org.infoset.xml.*;

/**
 *
 * @author R. Alexander Milowski
 */
public class IgnoreDocumentFilter implements ItemFilter {
   ItemDestination dest;
   public IgnoreDocumentFilter(ItemDestination dest) {
      attach(dest);
   }

   public void send(Item item) throws XMLException
   {
      Item.ItemType type = item.getType();
      if (type!=Item.ItemType.DocumentItem && type!=Item.ItemType.DocumentEndItem) {
         dest.send(item);
      }
   }
   
   public void attach(ItemDestination output)
   {
      this.dest = output;
   }

}
   